home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Resources / Developers / XAMPP 1.5.4 / Windows installer / xampp-win32-1.5.4-installer.exe / xampp / contrib / testperldbi.pl < prev    next >
Perl Script  |  2005-01-25  |  444b  |  22 lines

  1. #!/opt/lampp/bin/perl
  2. use DBI;
  3.  
  4. my $dsn = 'DBI:mysql:cdcol:localhost';
  5. my $db_user_name = 'root';
  6. my $db_password = '';
  7. my ($id, $password);
  8. my $dbh = DBI->connect($dsn, $db_user_name, $db_password);
  9.  
  10. my $sth = $dbh->prepare(qq{
  11.     SELECT id,titel,interpret,jahr FROM cds ORDER BY interpret;
  12. });
  13. $sth->execute();
  14.  
  15. while (my ($id, $title, $interpret, $jahr ) = 
  16.     $sth->fetchrow_array()) 
  17. {
  18.      print "$title, $interpret\n";
  19. }
  20. $sth->finish();
  21.  
  22.